Previous Book Contents Book Index Next

Inside Macintosh: QuickTime /
Chapter 2 - Movie Toolbox / Movie Toolbox Reference
Functions for Getting and Playing Movies / Enhancing Movie Playback Performance


LoadMediaIntoRam

The LoadMediaIntoRam function loads a media's data into memory.

The exact behavior of LoadMediaIntoRam is dependent on the media handler.

pascal OSErr LoadMediaIntoRam (Media theMedia, TimeValue time, 
                               TimeValue duration, long flags);
theMedia
Specifies the media for this operation. Your application obtains this media identifier from such Movie Toolbox functions as NewTrackMedia and GetTrackMedia (described on page 2-138 and page 2-190, respectively).
time
Allows you to specify a portion of the media to load. The time parameter contains the starting time of the media segment to load. The duration parameter specifies the length of the segment to load. This time value must be expressed in the media's time coordinate system.
duration
Allows you to specify a portion of the media to load. The time parameter contains the starting time of the media segment to load. The duration parameter specifies the length of the segment to load. You can use the GetMediaDuration function (described on page 2-179) to determine the length of the entire media. Note that the media handler may load more data than you specify if the media data was added in larger pieces.
flags
Gives you explicit control over what is loaded into memory and how long to keep it around. The following constants are provided:
            enum 
            {
               keepInRam = 1<<0,
               unkeepInRam = 1<<1,
               flushFromRam = 1<<2,
            };
You can set these flags in any combination that makes sense. For descriptions of the individual flag constants, see the description of the LoadMovieIntoRam function on page 2-125.
DESCRIPTION
If the LoadMediaIntoRam function fails because it is out of memory, no data is purged.

ERROR CODES
invalidMedia-2008This media is corrupted or invalid
invalidDuration-2014This duration value is invalid
invalidTime-2015This time value is invalid
progressProcAborted-2019Your progress function returned an error
File Manager errors
Memory Manager errors


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996